<template>
  <div class="container">
    <div class="case_container">
      <div class="case_list">
        <div
          class="case_item"
          @click="goOverview(item.value)"
          v-for="(item, index) in dict.type.plant_setting_type"
          :key="index"
        >
          <div class="img_box">
            <el-image
              :src="imgUrl + item.raw.img"
              style="width: 100%; height: 100%"
            />
          </div>
          <div class="title_box">
            <div style="margin: 10px 0; line-height: 35px">
              {{ item.label }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "BaseCase",
  components: {

  },
  dicts: ['plant_setting_type'],
  data() {
    return {

    }
  },
  created() {

  },
  computed: {
    imgUrl() {
      return process.env.VUE_APP_IP || ''
    },
  },
  methods: {
    goOverview(val) {
      this.$router.push({ path: '/overview', query: { type: val } })
    }
  }
};
</script>

<style lang="scss" scoped>
.case_container {
  margin: auto;
  padding-top: 20px;
  padding-bottom: 60px;
  width: 80%;
  min-height: calc(100vh - 200px);
}

.case_list {
  padding: 5px;
  width: 100%;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
}
.case_item {
  cursor: pointer;
  margin: 5px 10px 35px 5px;
  width: 32%;
  height: 250px;
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f2f3;
  border-radius: 5px;
  &:hover {
    box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.1);
  }
  .img_box {
    // flex: 1;
    height: 200px;
    border: 1px solid #ccc;
  }
  .title_box {
    color: #fff;
    background-image: linear-gradient(to right, #61a011, #fff);
    font-size: 18px;
    padding-left: 10px;
    height: 50px;
  }
}
@media screen and (max-width: 909px) {
  .case_item {
    width: 45%;
    height: 200px;
  }
}
</style>
